Subtyping for Object Type Constructors
نویسندگان
چکیده
Object type constructors have been introduced as an approach to adding container object types to a language with type inference. Useful subtyping for object type constructors requires a flexible subtype rule for type constructors that is not simply the pointwise extension of subtyping for types. At the same time, subtyping should avoid requiring run-time type checks, as in the Java subtype rule for arrays. An extension of object type constructors is considered to allow this subtyping, extending the kinds of object type constructors with polarities that allow this subtyping without jeopardizing soundness.
منابع مشابه
Subtyping Functional+Nonempty Record Types
Solving systems of subtype constraints (or subtype inequalities) is in the core of eecient type reconstruction in modern object-oriented languages with subtyping and inheritance, two problems known polynomial time equivalent. It is important to know how diierent combinations of type constructors innuence the complexity of the problem. We show the NP-hardness of the satissability problem for sub...
متن کاملSemantic subtyping between coinductive mutable record types with unions and intersections
Semantic subtyping between coinductive record types supports accurate type analysis of object-oriented languages, by introducing Boolean type constructors and modeling cyclic objects. In previous work, a sound and complete algorithm for semantic subtyping has been proposed, but only for coinductive immutable record types with unions. In this work we address the issue of extending the previous r...
متن کاملCoinductive subtyping for abstract compilation of object-oriented languages into Horn formulas
In recent work we have shown how it is possible to define very precise type systems for objectoriented languages by abstractly compiling a program into a Horn formula f . Then type inference amounts to resolving a certain goal w.r.t. the coinductive (that is, the greatest) Herbrand model of f . Type systems defined in this way are idealized, since in the most interesting instantiations both the...
متن کاملLogic of subtyping
We introduce new modal logical calculi that describe subtyping properties of Cartesian product and disjoint union type constructors as well as mutually-recursive types defined using those type constructors. Basic Logic of Subtyping S extends classical propositional logic by two new binary modalities ⊗ and ⊕. An interpretation of S is a function that maps standard connectives into set-theoretica...
متن کاملUsing Modes to Ensure Subject Reduction for Typed Logic Programs with Subtyping
We consider a general prescriptive type system with parametric polymorphism and subtyping for logic programs. The property of subject reduction expresses the consistency of the type system w.r.t. the execution model: if a program is"well-typed", then all derivations starting in a"well-typed"goal are again"well-typed". It is well-established that without subtyping, this property is readily obtai...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1999